/*
 * NavimeshRenderer.cpp
 *
 *  Created on: 15/08/2012
 *      Author: Aeradon
 */

#include "NavimeshRenderer.h"

NavimeshRenderer::NavimeshRenderer(Triangulation *triangulation) :
		Navimesh(triangulation)
{

}

NavimeshRenderer::~NavimeshRenderer()
{
	/// Navimesh calls method DestroyMesh here
}

NaviNode* NavimeshRenderer::CreateNode(Face* face)
{
	NavinodeRenderable* n = new NavinodeRenderable(face);
	v_node.push_back(n);
	n->vecIndex = v_node.size() -1;
	return n;
}

void NavimeshRenderer::RemoveNode(NaviNode* n)
{
	v_node[n->vecIndex] = v_node.back();
	v_node[n->vecIndex]->vecIndex = n->vecIndex;
	v_node.pop_back();
	delete n;
}

void NavimeshRenderer::OnSplit(NaviNode* nToSplit, NaviNode* n1, NaviNode* n2, NaviNode* n3)
{
	/// XXX Implement splitting correctly
}

void NavimeshRenderer::OnJoin(NaviNode* n1, NaviNode* n2, NaviNode* nJoined)
{
	/// XXX Implement joining correctly
}

void NavimeshRenderer::OnFlip(NaviNode* n1, NaviNode* n2)
{
	/// XXX Implement joining correctly
}
